package com.itgungnir.diyshuo.fragment.zhinan_fragment;

import com.itgungnir.diyshuo.activity.R;
import com.itgungnir.diyshuo.bean.DiyBean;
import com.itgungnir.diyshuo.http.HttpHelper;
import com.itgungnir.diyshuo.http.ListHelper;
import com.itgungnir.diyshuo.http.ListRetrofitService;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import retrofit2.Retrofit;
import rx.Observable;
import rx.Observer;
import rx.Scheduler;
import rx.Subscriber;
import rx.android.schedulers.AndroidSchedulers;
import rx.schedulers.Schedulers;

/**
 * Created by ITGungnir on 2016/10/5.
 */

public class ZhinanModel implements ZhinanContract.Model {

    @Override
    public void getZhinanData(Map<String, String> params, final ZhinanContract.OnLoadNewsListener listener) {
        final List<Integer> imgUrls=new ArrayList<>();
        imgUrls.add(R.mipmap.lunbo_1);
        imgUrls.add(R.mipmap.lunbo_2);
        imgUrls.add(R.mipmap.lunbo_3);

        ListHelper.getInstance().getListData(params, new Subscriber<DiyBean>() {
            @Override
            public void onCompleted() {

            }

            @Override
            public void onError(Throwable e) {

            }

            @Override
            public void onNext(DiyBean bean) {
                listener.onSuccess(bean,imgUrls);
            }
        });
    }
}
